/** xn 25.9.11 added a cvs server ... 
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
*/

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;  
/* import javax.swing.*;
import java.util.ArrayList;
import java.io.*;
import java.lang.*;
import javax.xml.parsers.*;
import org.xml.sax.*;
import org.w3c.dom.*;
import java.text.*; */

class Katze4_73 {
  // 8 15
  public static int position = 0;
  public static int position1 = 4;
  
  public static int position2 = 5;
  public static int position21 = 2; // position kaese
  				    // position kaese im umkreis von der katze
                                    // spawnen lassen, 3 kreise ...
  public static int ctimer2 = 0;
  static int val = -1;
  public static int position4 = 0;
  public static int position5 = 0;
  
  
  //private static NumberFormat cf =
  //NumberFormat.getCurrencyInstance();
  
  
  private static int[][] generate_path(int position112, int position113) {
    // testen, ob werte negiert werden, wenn sich
    // katze rechts vom kaese bewegt
    // differenz x posi
    // differenz y posi
    int tmp412 = position112 - position;
    int tmp413 = position113 - position1;
    // schnittpunkt ... 
    int[] patternd = {1,2,1,1,2,1,2,1,1,2,1,2,2,1,2,1,2,1,2};
    double tmp145 = Math.floor(tmp412 / 2);
    // -> 2
    // bei geraden laengen, davor-verlegen
    
    // bei patternd[1] .. abrunden
    // bei patternd[2] .. aufrunden ...
    
    // TODO: modifier einfuegen, 2 felder verschieben
    double tmp419 = Math.random()*18;
    tmp419 = Math.round(tmp419);
    int tmp420 = new Double(tmp419).intValue();
    
    int move[][] = new int[1024][1024];
    
    int tmp1124 = tmp412; //hoehe1;
    int tmp1125 = tmp413; // position x;
    
    // startpunkt position ...
    int c11 = position; // x1
    int c12 = position1; // y1
    int c1 = 0;
    
    
    int trigger1 = 0;
    int trigger21 = 0;
    int trigger2 = 0;
    int i1 = 0; // x= x position
    int i2 = 0; // counter array 1
    int i3 = 7 - position1; // uebernehmen von position-y
    int i4 = 0; // counter array 2
    
    // umlenkpunkt von hinten nach verlagern
    //
    //   xx
    //   x
    // xxx
    //
    //
    //
    //
    
    
    while (trigger1 == 0) {
      if (i1 == tmp145)
        trigger21 = 1;
      
      if (i1 > 50) {
        trigger1 = 1;
      }
      
      if (trigger21 == 1) {
      while (trigger21 == 1) {
        move[i2][0] = 0;
        move[i2][1] = -1;	
        
        if (i3 <= position1 + tmp413)
          trigger21 = 0;
        
        if (i2 > 50) {
          trigger21 = 0;
        }
        
        i2 ++;
        i3 --;
      }
      } else {
      if (i1 >= position && i1 < position + tmp412) {
        move[i2][0] = 1;
        move[i2][1] = 0;
        
        i2 ++;
      }
      }
      
      i1 ++;
    }
    
    // pattern 1,2,1,1,2,1,2,1,1,2,1,2,2,1,2,1,2,1,2
    return move;
  }
  
  //move = generate_move[0];
  //position1 = generate_move[1];
  //position2 = generate_move[2]; // ...................
  
  
  /* public static int[][] generate_move(int position, int position2, int position41, int position42) {
    
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    
    
    
    
    
    int [][][] return_value1 = new int[1024][1024][2];
    
    
    
    
    
    
    
    
    int[][] move = new int[1024][1024];
    
    int c3 = 0;
    
    int triggeri1 = 0;
    //for (int i = 0; i < 60; i ++) {
      // randomposition0 --> rechts, ... 1= x, 2= y-position
      double val32 = Math.random() * 3;
      val32 = Math.round(val32);
      triggeri1 = 0;
      for (int c2 = 0; c2 < 4; c2++) {
        if (position+1 < 7 && position1+1 < 15) {
          move[c3][0] = 0;
          move[c3][1] = 1;
          position += 0;
          position1 ++;
          c3 ++;
        } else {
          triggeri1 ++;
        }
      }
      for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
        position41 += 0;
        position42 += 1;
      }
      triggeri1 = 0;
      for (int c2 = 0; c2 < 4; c2++) {
        if (position1 > 0 && position < 7) {
          move[c3][0] = -1;
          move[c3][1] = 0;
          position ++;
          position1 += 0;
          c3 ++;
        } else {
          triggeri1 ++;
        }
      }
      for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
        position41 += -1;
        position42 += 0;
      }
      triggeri1 = 0;
      //3
      for (int c2 = 0; c2 < 4; c2++) {
        if (position1 > 0 && position > 0) {
          move[c3][0] = 0;
          move[c3][1] = -1;
          position += -1;
          position1 += 0;
          c3 ++;
        } else {
          triggeri1 ++;
        }
      }
      for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
        position41 += 0;
        position42 --;
      }
      triggeri1 = 0;
      for (int c2 = 0; c2 < 4; c2++) {
        if (position1 < 15 && position1 > 0) {
          move[c3][0] = 1;
          move[c3][1] = 0;
          position --;
          position1 += 0;
          c3 ++;
        } else {
          triggeri1 ++;
        }
      }
      for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
        position41 += 0;
        position42 += 1;
      }
    //} 
    
    for (int i = 0; i < 26; i ++) {
      //System.out.println(move[i][0]+" "+move[i][1]);
    }
    
    
    
    
    
    
    
    
    //System.out.println("asd sadsad sdasd");
    
    
    //int[][] move11 = new int[256][256];
    
    return (move, position41, position42);
  }
  */
  
  public static int[][][] test_1 (int [] position41, int [] position42) {
    
    int[][][] move = new int[10][10][10];
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return (move);
  } 
  
  public static void main(String[] args) {
    
    System.out.println("lol2");
    int [][] move = new int[1024][1024];
    move = test_1[0][0];
    position41 = test[0][0][1];
    position42 = test[0][0][2];
    
    
    
    
    
    
    
    
    
    
    // TODO: fuer generate path, 3 verschiedene funktionen machen, 
    // daystack mit integrieren
    // fuer hoehe y verschieben, eine position vorher y verschieben
    
    // TODO: xml liste mit importieren
    // ball mit implementieren ... 
    //
    // verschiedene moves, mit uebergang machen, aus
    // den xml beschreibungen und bewegungen machen ...
    
    //Document doc = getDocument("test.xml");
    //Element root = doc.getDocumentElement();
    //Element movieElement = (Element)root.getFirstChild();
    //item i;
    //while (movieElement != null)
    //  {
    //  i = getMovie(movieElement);
    //  String number = i.number;
    //  //String msg = Integer.toString(i.number);
    //  //msg += ": " + m.title;
    //  //msg += " (" + cf.format(m.price) + ")";
    //  System.out.println(msg);
    //  movieElement =
    //  (Element)movieElement.getNextSibling();
    //  }
    //    
    
    // item_stack[] ...
    // randomposition fuer kaese generieren    
    double position35 = Math.random() * 15;
    double position36 = 0;
    position35 = Math.round(position35);
    
    int position43 = 7;
    int position44 = 2;
    int position41 = 0;
    int position42 = 0;
    
    int c3 = 0;
    //int[][] move = new int[1024][1024];
    //move = generate_path(position2, position21);
    //move = generate_move(position, position1, position, position1);
    
    
    //System.out.println("lol");
    
    //for (int i = 0; i < 20; i ++) {
    //  System.out.println(move[i][0]+" "+move[i][1]);
    
    //}
    
    
    
    
    
    //move = generate_path2(position, position1);
    
    
    
    // 0 4
    // 6 2
    
    
    //for (int i = 0; i < 20; i ++) { 
    //  System.out.println(move[i][0]+" "+move[i][1]);
    //}
    
    
    
    
    
    
    
    // 1 2 1 1   1 1 0.5 2 0.5 1
    // vorlaeufiger test ... 1 runden, und dann eine kurze
    // pause und dann n runden
    int[][] val3121 = new int[2][4];
    int[] val415 = {0,1,2,3};
    val3121[0] = val415;
    int[] val515 = {3,2,1,0};
    val3121[1] = val515;
    int c14 = 0;
    
    
    // richtungsweisung, rechtsrum linksrum
    int[] val4122 = {1,1,2,1,2,1,1,2,1,2,2,2,1,2,1,2,2,2,1,2,2,2,2,1,2};
    
    int trigger85 = 1;
    int trigger51 = 0;
    
    int[] item_stack = new int[256];
    String[] item_stack1 = new String[256];
    
    item_stack[0] = 4;
    item_stack[1] = 3;
    item_stack1[0] = "kaese";
    // timer, count cat
    // int[] move = new int [4048000];
    
    double val112 = Math.random() * 1; // 2
    val112 = Math.round(val112);
    
    double tmp12 = Math.random() * 1; // 
    tmp12 = Math.round(tmp12);
    
    int tmp1113 = new Double(tmp12).intValue();
    //
    //
    //
    //
    //
    //
    //
    
    
    // patha generieren ... 
    
    
    
    
    // item_stack[] ...
    // 
    // randomposition fuer kaese generieren
    
    
    
    
    
    //int position = 2;
    //int position1 = 3;
    // timer, count cat
    // int[] move = new int [4048000];
    
    
    
    
    
    
    
    
    
    
    // verschieben von koordinaten system 
    // aufruf mehrerer pfade, ... pfade generieren
    
    // aufrufen von springerzug ...
    // pausen machen ....
    // 
    // 
    // 
    // 
    // 
    
    // verschiedene pfade generieren ...
    // von anfangspunkt 3-4 felder in die richtung
    // den schnittpunkt verlagern
    // 
    // 
    // 
    // 
    // 
    
    // --
    // kaese, zu dem kaese hingehen ...
    // xml liste machen, mit aufgaben ...
    // wo der kaese drin ist
    // 
    // zu dem kaese hingehen
    // an dem kaese richen
    // warten
    // 
    
    // script machen um zu kaese hinzugehen
    // den umlenkpunkt fur die katze kuenstlich verkuezen 6:4
    int xpos1 = 2;
    int ypos1 = 0;
    
    int xpos2 = 4;
    int ypos2 = 3;
    
    // specials fuer die maus mit dem fahhrad ueberlegen ...
    // textausgabe machen fuer
    // *ihr katze hat einen ueberschlag gemacht*
    // *ihr katze macht einen 5 m wheeli auf einem rad*
    // *ihre katze grindet mit dem fahhrad eine 90^ s-kurve*
    // 
    
    // scanner klasse um in 180^ zu sehen
    
    //
    // den stack beibehalten evtl. arraylisten machen laufen, warten ...
    // ducken ... rennen, implementieren, .... xml listen importieren, und
    // die uebergaenge mit implementieren
    // 
    // dinge betrachten als clear-type datenbank machen, und shepp programm
    // dafuer machen, tier 12 machen
    // 
    // umfassendes referate zu abstrakten heterogenen datenbank-netzen
    // machen, und das modul fuer sehen, und dinge betrachen auf das modell
    // anwenden
    // 
    // 
    // objektstack erweitern
    // 
    // 
    // objekte, zum sehen
    // 
    // objekte aus dem sichtfeld() { inc c = 7; // objektstack items[]
    // positionx positiony .. items1[] item names, item is visible ... item
    // ... level
    // 
    // objektstack sichtfeld auf 180^ grade erweitern sichtfeld drehen
    // ... auf grad objekte darauf abrattern, und auf alle objekte pointer
    // auf objektstack legen
    //
    
    // bewegungen fuer die katze erweitern
    // springerzug
    // zug
    // um die ecke gehen ...
    // 180^
    // 
    // normaler zug
    // marsch
    // wandern
    // rennen
    // kontrollieren
    // still stehen
    // *additional rush, einfach eine diagonale bilden, und im zickzack gehen
    //
    // normaler zug
    // springerzug
    // kleine pausen
    // normal gehen
    // 
    // marsch
    // grosse entfernungen zuruecklegen
    // sicher ab und zu springerzug
    // weitergehen
    // 
    // rennen
    // risikofactor ... 1:n
    // gegenkontrollieren mit schmerzen
    // 
    // kleine pausen
    // immer ein feld laufen und dann stehen bleiben
    // 
    // normal gehen
    // springerzug, kleines stueck gehen, pause
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    
    // 
    // 
    // 
    
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    // 
    
    // pausen einbauen ...
    // in den item-stack pausen einbauen
    // 
    // 
    // 
    
    // 
    //  v kurz v lang
    //  
    // 1:1:1:1:0:1:1:1:1:0:1:0:1:1:1:0 ~ :1:1:0 :0:0:1 v lang 1:1:1:0:1:1:1~
    // :1:1:0:1 :0:1~ :1:0 :0:1
    //
    
    /*int[][] patterna = new int[255][255];
    patterna[0][0] = 1;
    patterna[0][1] = 1;
    patterna[0][2] = 1;
    patterna[0][3] = 1;
    patterna[0][4] = 0;
    patterna[0][5] = 1;
    patterna[0][6] = 1;
    patterna[0][7] = 1;
    patterna[0][8] = 0;
    
    patterna[1][0] = 1;
    patterna[1][1] = 1;
    patterna[1][2] = 1;
    patterna[1][3] = 0;
    patterna[1][4] = 1;
    patterna[1][5] = 1;
    patterna[1][6] = 1;
    patterna[1][7] = 1;
    patterna[1][8] = 1;
    patterna[1][9] = 0;
    patterna[1][0] = 1; */
    
    //
    // for (1-20) ... move generiren ... random(1-4) ... laufrichtung rechts
    // ... -> 1:1:1:4
    // 
    // feld in eine richtung laufen .. pause = 0 0 0 0 0 0 0 fuer pause NULL
    // nehmen
    //
    
    // if (val41 == 3) {
    //   System.out.println("lol");
    
    // }
    
    // patternc = 0,0,0,1 bewegrichtung, anfangen mit pause ...
    
    // --*
    //double val51 = Math.random() * 3;
    //val51 = Math.round(val51);
    
    //String[][] move = new String[10][10]; // = new String[256][256];
    
    // --
    // for (int i = 0; i < 1; i++) {
    //  // direction
    //  // trigger_init starten
    //  // nach init, variable change einlegen, um richtung zu aendern auf
    //  // rechts ...
    //  // 
    //  double val32 = Math.random() * 3;
      
    //  // move hinzufuegen
    //  // for (int 1-7)
    //  move[i][0] = "NULL";
    //  move[i][1] = "";
    
    
    
    
    //System.out.println("position= "+position+" "+position1);
    // TEST: die startposition von 7 2 auf 0 0 verlegen, und testen ob die startposition genau
    // ausgegeben wird.
    // TEST: die ersten 4 felder nach rechts gehen, danach keine bewegung mehr
    
    
    
    // generate day stack
    // choose task ...
    // generate_path, generate_move, generate_path (2)
        
    //move = generate_path(position2, position21);
    
    
    //Timer timer = new Timer();
    //MyTask task = new MyTask( 40, timer, move, position, position1, position43, position44);
    // Schedule the task to run every 3,000 millisecs or 3 seconds starting
    // right from the beginning.
    //timer.schedule( task, 0, 1000 );
  }
}

class MyTask extends TimerTask
{
  int maxNumberOfTimesToRun = 0;
  // A reference to a date object
  Date currentDateTime = null;
  static int counter = 1;
  //static int[] move_4;
  Timer myTimer = null;
  //private static double position;
  //private static double position1;
  static double position2 = 0;
  int move[][] = new int[1024][1024];
  static int position = 0;
  static int position1 = 0;
  static int position43 = 0;
  static int position44 = 0;
  
  static int position4 = 0;
  

  // Default Constructor
  public MyTask( int maxCounter, Timer aTimer, int[][] amove, int aposition, int aposition1, int aposition43, int aposition44 )
  {
    super();
    maxNumberOfTimesToRun = maxCounter;
    myTimer = aTimer;
    move = amove;
    position = aposition;
    position1 = aposition1;
    position43 = aposition43;
    position44 = aposition44;
    //move_4 = amove_4;
  }
  
  // Override the abstract method  run()
  public void run()
  {
    if ( MyTask.counter <= maxNumberOfTimesToRun )
    {
      // System.out.println( MyTask.counter );
      // Create a current date instance
      currentDateTime = new Date( System.currentTimeMillis() );
      // Display the current date object as a string
      String line = "";
      
      
      // testen wie positionierungsausgabe x1 y1 ausgegeben wird ...
      // testen ob levelwaende/ coordinaten richtig getroffen werden
      
      
      // testen ob test move auf level richtig angewand wird
      
      
      
      
      for (int i = 0; i < 16; i ++) {
        System.out.println(move[i][0]+" "+move[i][1]);
      }

      
      //System.out.println("+							     +");
      
      int trigger4 = 0;
      for (int c = 0; c < 7; c ++) {
        line = " ";
      	for (int c2 = 0; c2 < 15; c2 ++) {
          
          
          
          //System.out.println("if("+position1+" == "+c+" && "+position+" == "+c2+")");
          
          if (c == position1 && c2 == position) {
            line += ". 0 ";
          } else {
            trigger4 = 1;
          }
          
          // kaese spawnen lassen
          if (c == position43 && c2 == position44) {
            line += ". * ";
          } else {
            trigger4 = 1;
          }
          
          
          if (trigger4 == 1) {
            line += ".   ";
          }
          
          
      	}
        trigger4 = 0;
        line += "\n";
        //System.out.println(line);
      }
      
      position += move[position4][0];
      position1 += move[position4][1];
      
      //System.out.println("+							     +");
      //System.out.println("\n\n");
      
      
      position4 ++;
      MyTask.counter++;
    }
    else
    {
      // Since we reached the counter max, cancel the task
      cancel();
      // Also cancel the timer since I'm the only one using it.
      // This might not be true in all case
      //
      //
    }
  }
}


    
    /*
    // TODO: ads asdsdasd ... 
    for (int i = 0; i < 10; i++) {
      
      // position berechnen
      // randomposition0 --> rechts, ... 1= x, 2= y-position
      double val32 = Math.random() * 3;
      val32 = Math.round(val32);
      if (val32 == 0) {
        if (val112 == 0) {
          if (tmp12 == 0 && position <= 14 && position1 >= 1) {
            move[c3][0] = 1;
            move[c3][1] = 0;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
            // TODO: fuer das move 8 nullen einfuegen 
          }
          if (tmp12 == 1 && position <= 14 && position1 <= 7) {
            move[c3][0] = 1;
            move[c3][1] = 0;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = 1;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
        if (val112 == 1) {
          if (position1 >= 2) {
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
        if (val112 == 2) {
          if (position1 >= 1) {
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 += 2;
          }
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
      }
      if (val32 == 1) {
        if (val112 == 0) {
          if (tmp12 == 0 && position >= 1 && position1 <= 7) {
            move[c3][0] = 0;
            move[c3][1] = 1;
            c3 ++;
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
          }
          if (tmp12 == 1 && position <= 14 && position1 <= 7) {
            move[c3][0] = 0;
            move[c3][1] = 1;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = 1;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
	  position41 += move[c3-2][0];
          position42 += move[c3-2][1];
        }
        if (val112 == 1) {
          if (position1 <= 13) {
            move[c3][0] = 1;
            move[c3][1] = 0;
            c3 ++;
            move[c3][0] = 1;
            move[c3][1] = 0;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
        if (val112 == 2) {
          if (position <= 14) {
            move[c3][0] = 1;
            move[c3][1] = 0;
            c3 ++;
          }
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
      }
      if (val32 == 2) {
        // direction = down, 1 move left, 0 move right
        if (val112 == 0) {
          if (tmp12 == 1 && position >= 1 && position1 <= 7) {

            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = 1;
            c3 ++;
          }
          if (tmp12 == 0 && position >= 1 && position1 >= 1) {
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
          position41 += move[c3-1][0];
          position42 += move[c3-1][0];
        }
        if (val112 == 1) {
          if (position1 <= 6) {
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
        if (val112 == 2) {
          if (position1 <= 7) {
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
          }
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
      }
      if (val32 == 3) {
        if (val112 == 0) {
          if (tmp12 == 1 && position >= 1 && position1 >= 1) {
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
          }
          if (tmp12 == 0 && position <= 14 && position1 >= 1) {
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
            move[c3][0] = 0;
            move[c3][1] = 1;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
        if (val112 == 1) {
          if (position1 >= 2) {
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
          }
          position41 += move[c3-2][0];
          position42 += move[c3-2][1];
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
        if (val112 == 2) {
          if (position1 >= 1) {
            move[c3-1][0] = -1;
            move[c3-1][1] = 0;
            c3 ++;
          }
          position41 += move[c3-1][0];
          position42 += move[c3-1][1];
        }
      }
    }
} */

/*
class MyTask extends TimerTask {
  int maxNumberOfTimesToRun = 0;
  // A reference to a date object
  Date currentDateTime = null;
  static int counter = 1;
  Timer myTimer = null;
  int tmpval = 0;
  int[][] move = new int[1024][1024];
  int position4 = -1;
  static int position = 4;
  static int position1 = 3;
  static int aposition4 = 0;
  
  // Default Constructor
  public MyTask(int maxCounter, Timer aTimer, int position4, int[][] amove) {
    super();
    maxNumberOfTimesToRun = maxCounter;
    myTimer = aTimer;
    // tmpval = aval;
    move = amove;
    // counter = 1;
    position4 = aposition4;
  }
  
  // Override the abstract method run()
  public void run() {
    if (MyTask.counter <= maxNumberOfTimesToRun) {
      String line = "";
      
      int val432 = 0;
      int trigger1 = 0; // trigger test, test if path exists in array
      int trigger2 = 0; 
      
      int trigger4 = 0;
      int trigger5 = 0;
      int trigger42 = -1; // trigger42 == c
      
      int trigger6 = 0;
      int trigger61 = 0;
      int trigger81 = 0;
      int trigger82 = 0;
      int trigger83 = 0;
      int c13 = 0;
      
      //tmp
      int trigger84 = 0;
      int i1 = 0;
      
      
      System.out.println("+							     +");
      for (int c = 0; c < 7; c ++) {
        line = " ";
        
        
        
        for (int c2 = 0; c2 < 15; c2 ++) {
          //for (int i1 = 0; i1 < 8; i1 ++) {
          //  val432 = 7-c;
          //  // fitting variable position y goes here ==> move[i1][1]
          //  if (move[i1][0] == val432 && move[i1][1] == c2)
          //    trigger61 = 1;
          //    //System.out.println("x = "+move[i1][1]+" y = "+move[i1][0]);
          //}
          
          //if (trigger61 == 0) {
          //  line += ".   ";
          //} else {
          //  line += ". * ";
          //}
          
          //trigger61 = 0;
          
          // TODO: trigger43 machen, und auch auf != x machen
          // fuer jeden aufruf von y .. position testen
          trigger42 = -1;
          //int i2 = 0;
          
          position += move[i1][0];
          position1 += move[i1][1];
          
           
          //if (c == position && position1 == c2) {
          //  trigger42 = 1;
          //}
          
          
          
          // while (trigger42 == -1) {
          //  if (i1 < 10)
          //    System.out.println("if (move[i1][0] --> "+move[i1][0]+" == "+c+" && move[i1][1] --> "+move[i1][1]+" == "+c2);
            
            
            
            
          //  if (move[i1][0] == c && move[i1][1] == c2) {
          //    trigger42 = 1;
              
          //  }
          //  if (i1 < 124000)
          //    trigger42 = 1;
            
          //  i1 ++;
            //i2 ++;
          //}
          
          
          
          //for (int i1 = 0; i1 < move.length; i1 ++) {  
          //  if (move[position4][0] == c) {
          //    for (int i2 = 0; i2 < move.length; i2 ++) {
                
          //      //System.out.println(c2+" == "+move[i2][0]);
          //      if (c2 == move[position4][1])
          //        trigger42 = 1;
          //        line += ". * ";
                
          //      } else {
          //        //line += ".   ";
          //    }
        //      }
          //  }
          //}
          
          
          if (position == c && position1 == c2) {
            line += ". 0 ";
          } else {
            line += ".   ";
            
          }
          
          trigger42 = 0;
          i1 ++;
        } 
        
        
        line += "\n";
        System.out.println(line);
      }
      System.out.println("");
      System.out.println("+							     +");
      System.out.println("\n\n");
      
      //position += x;
      //position += y;
      
      
      
      position4 ++;
      
      // Katze4_7.setCtimer1(ctimer2); // set counter timer 1 ... timer
      // katze display
      
      currentDateTime = new Date(System.currentTimeMillis());
      MyTask.counter++;
    } else {
      // Since we reached the counter max, cancel the task
      cancel();
      // Also cancel the timer since I'm the only one using it.
      // This might not be true in all cases
      myTimer.cancel();
    }
  }
  */
  /*
  // --
  private static Document getDocument(String name)
    { 
    try 
      { 
      DocumentBuilderFactory factory = 
      DocumentBuilderFactory.newInstance(); 
      factory.setIgnoringComments(true); 
      factory.setIgnoringElementContentWhitespace(true); 
      factory.setValidating(true); 
      DocumentBuilder builder = 
      factory.newDocumentBuilder(); 
      return builder.parse(new InputSource(name)); 
      } 
    catch (Exception e) 
      { 
      System.out.println(e.getMessage()); 
      } 
    return null; 
    }

  private static Movie getMovie(Element e)
    { 
    // get the year attribute 
    String yearString = e.getAttribute("year"); 
    int year = Integer.parseInt(yearString); 
    // get the Title element
    Element tElement = (Element)e.getFirstChild();
    String title = getTextValue(tElement).trim();
    // get the Price element
    Element pElement =
    (Element)tElement.getNextSibling();
    String pString = getTextValue(pElement).trim();
    double price = Double.parseDouble(pString);
    return new Movie(title, year, price);
    }
  
  private static String getTextValue(Node n) 
    { 
    return n.getFirstChild().getNodeValue(); 
    }
  
  public void Movie(String title, int year, double price)
  {
    this.title = title;
    this.year = year;
    this.price = price;
  }
*/
/*
}
*/
/* private static class Movie
  { 
    public String title; 
    public int year; 
    public double price; 
  }
*/

    







/*
    for (int i = 0; i < 3; i ++) {
      // randomposition0 --> rechts, ... 1= x, 2= y-position
      //double val32 = Math.random() * 3;
      //val32 = Math.round(val32);
        int triggeri1 = 0;
        for (int c2 = 0; c2 < 4; c2++) {
          if (position+c2 < 15 && position1+c2 < 7) {
            move[c3][0] = 1;
            move[c3][1] = 0;
            c3 ++;
          } else {
            triggeri1 ++;
          }
        }
        for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
          position41 += 1;
          position42 += 0;
        }
        int triggeri1 = 0;
        for (int c2 = 0; c2 < 4; c2++) {
          if (position+c2 < 15 && position1+c2 < 7) {
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
          } else {
            triggeri1 ++;
          }
        }
        for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
          position41 += 0;
          position42 += -1;
        }
        int triggeri1 = 0;
        for (int c2 = 0; c2 < 4; c2++) {
          if (position-c2 > 0 && position1-c2 > 0) {
            move[c3][0] = -1;
            move[c3][1] = 0;
            c3 ++;
          } else {
            triggeri1 ++;
          }
        }
        for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
          position41 += -1;
          position42 += 0;
        }
        int triggeri1 = 0;
        for (int c2 = 0; c2 < 4; c2++) {
          if (position-c2 > 0 && position1-c2 > 0) {
            move[c3][0] = 0;
            move[c3][1] = -1;
            c3 ++;
          } else {
            triggeri1 ++;
          }
        }
        for (int c4 = 0; c4 < 4 - triggeri1; c4 ++) {
          position41 += 0;
          position42 += -1;
        }
    }
*/
